package com.leileimann.tour.mapper;

import com.leileimann.tour.entity.Collect;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author leileiMann
 * @date 2022/3/25 17:54
 */
@Mapper
@Repository
public interface CollectMapper {

    //通过传入的名字搜索相应的实体
    Object getObjByCollectName(@Param("collectname")String collectname,@Param("tel")String tel);

    //通过电话号码搜索用户的所有收藏
    List<Collect> getAllCollectByTel(@Param("tel")String tel);

    //添加新的收藏 返回的也是相应的三个参数
    String createCollect(@Param("collectname")String collectname,
                         @Param("tel")String tel,@Param("collectTime")String collectTime
                        ,@Param("locationX")String locationX,@Param("locationY")String locationY);

    //取消收藏
    void moveCollect(@Param("collectname")String collectname,@Param("tel")String tel);
}
